package com.lumlord.common.shiro.service;

import org.apache.shiro.spring.aop.SpringAnnotationResolver;
import org.apache.shiro.spring.security.interceptor.AopAllianceAnnotationsAuthorizingMethodInterceptor;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;

import com.lumlord.common.annotation.Api;

@Aspect()
public class ShiroAnnotationAuthorizingAspect {

    private static final String pointCupExpression =
            "execution(@com.lumlord.common.annotation.Api * *(..))";

    @Pointcut(pointCupExpression)
    public void anyShiroAnnotatedMethod(){}

    @Pointcut(pointCupExpression)
    void anyShiroAnnotatedMethodCall(JoinPoint thisJoinPoint) {
    	 System.out.println(thisJoinPoint);
    }
    

    @Before("anyShiroAnnotatedMethodCall(thisJoinPoint)")
    public void executeAnnotatedMethod(JoinPoint thisJoinPoint) throws Throwable {
      
    }
} 
 